import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//如果不是生产环境就引入mock文件
if(process.env.NODE_ENV !=='production') require('./mock/index')
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

/*

//通过render渲染
const handleClick = (even)=>{
  //阻止冒泡
  even.stopPropagation()
  console.log(even);
}
//再ul元素里循环创建li元素
const  list = [{name:'张三'},{name:'李四'}]
const getLi = (h)=>{
  return list.map((item,index)=>h('li',{
    on:{
      'click':handleClick
    },
    key:index
  },item.name))
}
new Vue({
  router,
  store,
  render: h => h("div",[
    h('ul',getLi(h))
  ])
}).$mount('#app')

*/